<template>
	<div>
		<order :storeId ="storeId" :config ="config" v-if="pagetype=='_order'" @ement="ement"></order>
		<product :storeId ="storeId" :config ="config" v-else  @ement="ement"></product>
	</div>
</template>

<script>
	import order from '@/components/stock/record/_order.vue';
	import product from '@/components/stock/record/_product.vue';
export default {
	components: {order,product},
	props:['storeId'],
  	data(){
		return {
			pagetype:'',
			config:'Warehouse'
		}
	},
	watch:{
	   
	},
	methods:{
		ement(v){
			this.pagetype = v;
			sessionStorage.setItem('oun_in_stock',v);
		}
	},
	created () {
		if(!sessionStorage.getItem('oun_in_stock')){
			// sessionStorage.setItem('oun_in_stock','_order');
			sessionStorage.setItem('oun_in_stock','_product');
		};
		this.pagetype = sessionStorage.getItem('oun_in_stock');
	},
	mounted() {
		
	},
	beforeDestroy() {
		sessionStorage.removeItem('oun_in_stock');
	}
}
</script>
<style lang="scss" scoped>
	@import "record";
</style>